import { Component, OnInit, Input } from '@angular/core';
import {Project} from "../entity/Project";
import {ProjectFindService} from "../service/project.find.service";
import {Router} from "@angular/router";
@Component({
  selector: 'project-recommended-list',
  templateUrl: './project-recommended.html',
  styleUrls:['./project-recommended-list.css'],
})

export class ProjectRecommendComponent
implements OnInit
{
  public projects:Array<Project>;


  ngOnInit(): void {
    this.getProjectList("1");
  }


  constructor(private projectService: ProjectFindService,
              private router: Router) { }

  public getProjectList(siteId:string){
    this.projectService.getProjectList(siteId)
      .then(projects => this.projects = projects);
  }
  public toProjectIndex(id:string){

    this.router.navigate(['/project/index/',id]);
  }

}
